bom tava tentando fazer aqui o melhor que conseguir fazer foi assim
ver video em tela grande eu não tenho newtype de moto então coloquei 127 de test
ta parando no pz
data\npc\nomedonpc.xml
<npc name="NPC NOME" script="data/npc/scripts/nmoto.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="78" body="88" legs="0" feet="88" addons="3"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|.voce deseja viajar?" /> <parameter key="message_farewell" value="Tchau." /> <parameter key="message_walkaway" value="Tchau." /> </parameters> </npc>
data\npc\scripts\nmoto.lua
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
pos = {x=1060,y=1065,z=7} -- aqui coloca na onde que vai ativa a moto
newtypemoto = 127 -- newtype da sua moto
effect = 34 -- efeito que sair atrás da moto fumaças
local storages = { speed = 115625, status = 222995 } -- storages
local cfg = { min_speed = 300, -- não mexe ou deixa de 200 a 300 pode regular
max_speed = 200, -- melhor não diminuir do que isso [a velocidade máxima da sua Moto ]
Moto_Explode = true -- não mexe
}
function isWalkable(pos, creature, pz)
if getTopCreature(pos).uid > 0 and creature then return false end
if getTileInfo(pos).protection and pz then return false, true end
local n = not proj and 3 or 2
for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
return false
end
end
end
return true
end
function getMotoSpeed(cid) return getPlayerStorageValue(cid,storages.speed) end
function setMotoSpeed(cid,value) return setPlayerStorageValue(cid,storages.speed, getPlayerStorageValue(cid,storages.speed) + value) end
function setMotoStatus(cid,value) return setPlayerStorageValue(cid,storages.status,value) end
function MotoMove(cid) return getPlayerStorageValue(cid,storages.status) > 0 and true or false end
function move(cid,time)
local dir = getCreatureLookDir(cid)
local place = getPositionByDirection(getThingPos(cid),dir,1)
if isWalkable(place,true,true,true) then
doTeleportThing(cid,place,false)
addEvent(doSendMagicEffect,time+10,place,effect)
if MotoMove(cid) then
addEvent(move,time,cid,getMotoSpeed(cid))
else
end
else
doCreatureSetNoMove(cid, 0)
doPlayerSendTextMessage(cid,27,"You have hit somthng.")
setMotoStatus(cid,0)
if cfg.Moto_Explode then
doRemoveCondition(cid, CONDITION_OUTFIT)
doSendAnimatedText(getThingPos(cid),"Crashed",TEXTCOLOR_RED)
doSendMagicEffect(getThingPos(cid),31)
end
end
end
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if msgcontains(msg, 'yes') then
selfSay("OK! boa viajem.", cid)
if doTeleportThing(cid, pos) then
doSetCreatureOutfit(cid, {lookType = newtypemoto}, -1)
if not MotoMove(cid) then
end
setPlayerStorageValue(cid,storages.speed,cfg.min_speed)
setMotoStatus(cid,1)
doCreatureSetNoMove(cid, 1)
move(cid,getMotoSpeed(cid))
else
doPlayerSendCancel(cid,"Moto is already moving.")
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())










info
Grupo: Barão
Registrado: 17/10/10
Posts: 230
Reputação: +10
Char no Tibia: Nascont
Ola pessoal olha eu aqui de novo =D
dessa vez vim pedir um script dificil mais não imposivel queria um script que fizesse o seguinte:
O player fala com o npc:
player: HI
npc: ola (player name) voçe deseja viajar?
player:Yes
npc: OK! boa viajem.
logo em seguiada o player quanha um outifit EX: outifit de um carinha montado na moto (eu ja tenho aki)
e segue uma rota pre-destinada ate o local, que irei editar aki.
OBS: ate chegar la o player n podera se mexer.
quando o player chega la a outifit sai e ele volta ao normal.
valendo rep+